﻿<Controls:SinacorWindow  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                                    xmlns:Custom="http://schemas.xceed.com/wpf/xaml/datagrid"
                                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                                    mc:Ignorable="d"
                                    xmlns:Model="clr-namespace:Sinacor.UI.Bovespa.Corretagem.Model;assembly=Sinacor.UI.Bovespa.Corretagem.Model"
                                    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
                                    WindowStartupLocation="CenterScreen" 
                                    AutoContentHeight="True" 
                                    AutoContentWidth="True"
                                    WindowState="Normal"
                                    Width="790"
                                    Height="650"
                                    Title="{DynamicResource Bovespa.Corretagem.Label.CadastroTipoAplicacaoPolitica}"
                                    x:Class="Sinacor.UI.Bovespa.Corretagem.View.SmartClient.CadastroTipoAplicacaoPolitica" 
                                    ModulePlus="False"
                                    ModuleId="ORD">

    <Controls:SinacorExpanderContainer x:Name="ExpanderContainer"
                                       VerticalAlignment="Stretch">


        <Controls:SinacorExpander HorizontalAlignment="Stretch"												
                                  VerticalAlignment="Stretch"												
                                  Header="{DynamicResource Bovespa.Corretagem.Label.Tipos}"
                                  IsExpanded="True" TabIndex="5" AllowExpand="False">
            <Grid>
                <Controls:SinacorDataGrid x:Name="dtgTipoAplicacaoPolitica" ItemsSource="{Binding TiposAplicacoesPoliticas}"  							 		
                                          AllowBeginUpdate="True"
                                          AllowCancelUpdate="True"
                                          AllowDelete="True"
                                          AllowBeginInsert="True"
                                          AllowCancelInsert="True"
                                          AllowSave="True"	
                                          IsSynchronizedWithCurrentItem="True"
                                          HorizontalAlignment="Stretch"
										  Width="Auto" Height="Auto" Margin="0,0,0,0"
                                          InsertBegun="dtgTipoAplicacaoPolitica_InsertBegun"
                                          CancelingInsert="dtgTipoAplicacaoPolitica_CancelingInsert"
                                          EndingInsert="dtgTipoAplicacaoPolitica_EndingInsert"
                                          UpdateBegun="dtgTipoAplicacaoPolitica_UpdateBegun"
                                          CancelingUpdate="dtgTipoAplicacaoPolitica_CancelingUpdate"
                                          EndingUpdate="dtgTipoAplicacaoPolitica_EndingUpdate"
                                          Deleting="dtgTipoAplicacaoPolitica_Deleting">
                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="Codigo"								 				
                                         AutoAdjustWidthToContent="True" 									 				
                                         Title="Bovespa.Corretagem.Label.Codigo"
										 HorizontalCellAlignment="Right"	
                                         DisplayMemberPath="Codigo"
                                         AllowInsert="True">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                        <Controls:SinacorInt32TextBox
                                                x:Name="txtCodigo"
                                                Value="{Binding Codigo}"
                                                IsFormated="False"
                                                Integers="2"
                                                IsRequired="True"                                            
                                                RequiredErrorMessage="Bovespa.Corretagem.Message.CodigoTipoAplicacaoPoliticaObrigatorio"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="Descricao" 				
                                         AutoAdjustWidthToContent="False"
                                         Width="200"
                                         Title="Bovespa.Corretagem.Label.Descricao" 
                                         DisplayMemberPath="Descricao"
                                         AllowInsert="True"
                                         AllowUpdate="True"
                                         CellInsertTemplate="{Binding Path=CellUpdateTemplate, RelativeSource={RelativeSource Self}}">
                            <Controls:Column.CellUpdateTemplate>
                                <DataTemplate>
                                    <Controls:SinacorTextBox
                                                Text="{Binding Descricao}"
                                                x:Name="textDescricao"
                                                IsRequired="True" 
                                                MaxLength="20"
                                                RequiredErrorMessage="Bovespa.Corretagem.Message.DescricaoTipoAplicacaoPoliticaObrigatorio"/>
                                </DataTemplate>
                            </Controls:Column.CellUpdateTemplate>
                        </Controls:Column>
                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>
            </Grid>
        </Controls:SinacorExpander>
    </Controls:SinacorExpanderContainer>
</Controls:SinacorWindow>